import mongoose from '../dbHelper';
import {defaultSchemaExtend, defaultSchemaOptions} from "../config/index";

const Schema = mongoose.Schema;

const DlyAdminShopUserSchema = new Schema(Object.assign({
    shopIds: [{type: Schema.Types.ObjectId, ref: 'Shop'}],
    proxyId: {type: Schema.Types.ObjectId, ref: 'DlyAdminUser'},
    linkId: {type: Schema.Types.ObjectId, ref: 'DlyAdminLink'},
    uuId: {type: String, required: true},
    proxyName: {type: String},
    orderIds: [{type: Schema.Types.ObjectId, ref: 'Order'}],
    proxyExpires: {type: Date},
 
}, defaultSchemaExtend), defaultSchemaOptions);

const DlyAdminShopUser = mongoose.model('DlyAdminShopUser', DlyAdminShopUserSchema, 'DlyAdminShopUsers');

export default DlyAdminShopUser